package com.demo.homework;

/**
 * @ClassName Worker
 * @Description TODO
 * @Author tianqinglong
 * @Date 17:50 2022/7/5
 * @Version 1.0
 **/
public class Worker {
    private String name;
    private String job;
    private int salary;

    public Worker() {
    }

    public Worker(String name, String job, int salary) {
        this.name = name;
        this.job = job;
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public int getSalary() {
        return salary;
    }

    public void setSalary(int salary) {
        this.salary = salary;
    }

    @Override
    public String toString() {
        return "Worker{" +
                "name='" + name + '\'' +
                ", job='" + job + '\'' +
                ", salary=" + salary +
                '}';
    }
    public int doJob(int months){
        System.out.println(this.getName()+"工作了"+months+"个月,"+"获得"+months*this.getSalary()+"工资");
        return months*this.getSalary();
    }
}
class Main{
    public static void main(String[] args) {
        Worker worker = new Worker("张三","经理",10000);
        worker.doJob(10);
    }
}
